﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Menu
{
    class Snack : MenuItem
    {
        public double price { get; private set; }

        public Snack(string name, double price) : base(name)
        {
            if (price <= 0)
            {
                throw new Exception("Price should be greater than 0");
            }
            else
            {
                this.price = price;
            }
        }

        public override void PrintToConsole()
        {
            Console.WriteLine("{0} - Price: ${1}", base.name, price);
        }
    }
}
